package com.fbinggun.fbinggunutil.gui.item;

import com.fbinggun.fbinggunutil.gui.FHolder;
import com.fbinggun.fbinggunutil.gui.SlotItem;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.plugin.java.JavaPlugin;

public class PgUp extends SlotItem {
    public PgUp(String id, ConfigurationSection config) {
        super(id, config);
    }
    @Override
    public void run(Player player, InventoryClickEvent event, JavaPlugin plugin, FHolder fHolder) {
        event.setCancelled(true);
        player.closeInventory();
        fHolder.getGui().openInventory(player,fHolder.getPage()-1);
        return;
    }
}
